package com.bruce.spring.http.client.autoconfigurate;

import com.bruce.spring.http.client.filter.TraceFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

/**
 * Created by bruce in 2025/6/17 02:14
 */
@Configuration(proxyBeanMethods = false)
public class AutoConfig {


    @Bean
    public FilterRegistrationBean<TraceFilter> traceFilter() {
        TraceFilter filter = new TraceFilter();
        FilterRegistrationBean<TraceFilter> registration = new FilterRegistrationBean<>(filter);
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return registration;
    }



}
